{include file="public/header" /}
<body class="bg-white">
    <header class="all-header">
        <p class="all-header-item">
            <i class="layui-icon layui-icon-left"></i>
        </p>
        <p class="all-header-item">合同起草</p>
    </header>
    <form action="" method="GET">
        <div class="flex-box-input">
            <span class="fbi-item">案件简介：</span>
        </div>
        <div class="flex-box-input layui-bg-gray">
                <textarea class="layui-bg-gray subdetail" name="casedetail" id="casedetail" placeholder="请输入简单描述一下你上传合同的目的"></textarea>
        </div>
        <div class="layui-form-item">
            <!--<label class="layui-form-label upfile">上传文件</label>-->
            <div class="line">
                <input type="text" name="thumb" placeholder="文件大小不超过5M！" class="layui-input thumb">
                &nbsp; <button type="button" onclick="GetUploadify(12,'articles');" class="layui-btn bg-yellow">上传文件</button>
            </div>
        </div>
        <button class="shop-btn bg-yellow" type="submit" class="order-btn">提交案件</button>
    </form>

    <div class="attention bg-white">
        <p>注意事项：</p>
        <p>1.推荐上传word文档</p>
        <p>2.推荐上传word文档</p>
        <p>3.推荐上传word文档</p>
        <p>4.推荐上传word文档</p>
    </div>
</body>
<script type="text/javascript">
    layui.use(['form'], function () {
        var form = layui.form;
        $("#from").submit(function (e) {
            e.preventDefault(); //阻止get提交
            var list = $(this).serialize();
            $.post("{:url('submit_case/add')}",list,function (ret) {
                if(ret.code == 1){
                    layer.msg(ret.msg)
                    setTimeout(function () {
                        location.reload();
                    },2000);
                }else{
                    layer.msg(ret.msg)
                }
            })
        });
        form.render();
    });
    //返回路径插入到指定元素
    function upload_callback(url)
    {
        $('input[name=thumb]').val(url);
    }
</script>
</html>